package com.smart.platform.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.time.LocalDateTime;

//学生成绩实体类
@Data
public class Score {

    //主键
    private Long id;

    //学号
    private String userId;

    //姓名
    private String name;

    //班级
    private Integer classes;

    //年级
    private Integer grade;

    //用来判断是期中考试还是期末考试的
    private Integer state;


    //总成绩
    //@TableField(value = "sum(total)", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private Double total;

    //语文
    private Double chinese;

    //数学
    private Double math;

    //英语
    private Double english;

    //物理
    private Double physics;

    //化学
    private Double chemistry;

    //生物
    private Double biology;

    //政治
    private Double political;

    //历史
    private Double history;

    //地理
    private Double geography;

    //创建时间只在插入的时候设置，更新时间在插入和更新的时候都要设置，所以update是INSERT_UPDATE，create是INSERT
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    //创建时插入字段
    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUser;
}
